// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'

import 'babel-polyfill'

/* 引入element */
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'

/* 引入权限 */
import './permission'

import store from './store'

import App from './App'
import router from './router'

/* 引入过滤器 */
import * as filters from './filters'

/**
 * 引入扩展的js
 */
import '@/utils/UtilJs'

/* 使用ElementUI，必须在引入utilsJs之前，因为会有依赖 */
Vue.use(ElementUI, {size: 'small'})

// 引入mockjs
if (process.env.NODE_ENV === 'development') {
  // require('./mock.js')
}

/* 注册全局的过滤器函数 */
Object.keys(filters).forEach(key => {
  Vue.filter(key, filters[key])
})

Vue.config.productionTip = false

/* eslint-disable no-new */
new Vue({
  el: '#app',
  store,
  router,
  components: { App },
  template: '<App/>'
})
